# -*-coding: Utf-8 -*-
# @File : schemas_base .py
# author: Chimengmeng
# blog_url : https://www.cnblogs.com/dream-ze/
# Time：2023/10/7
from datetime import datetime

from pydantic import BaseModel


# 定义创建数据的格式
class CreateUser(BaseModel):
    username: str
    password: str
    phone: str
    email: str


class Login(BaseModel):
    username: str
    password: str


# 定义读取数据的格式
class ReadData(BaseModel):
    # 主键 id
    id: int
    username: str
    phone: str
    email: str
    updated_at: datetime
    created_at: datetime

    # 定义配置：允许使用 orm 语句
    class Config:
        orm_mode = True
